-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lockdown_cafe #1252
base: master
Are you sure you want to change the base?
lockdown_cafe #1252
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your hard work on this project! 😊 While your implementation is mostly correct and aligns well with the task description, there are a few critical issues that need to be addressed before we can approve the pull request:
-
Descriptive Error Messages: The
visit_cafe
method in theCafe
class should raise exceptions with descriptive messages. This is important for clarity and debugging purposes. Please ensure that each exception raised includes a descriptive message, as highlighted in the review comments. -
Use of
try/except
ingo_to_cafe
: The task requires usingtry/except
blocks to handle exceptions in thego_to_cafe
function. This is crucial for proper error handling and ensuring the function behaves as expected in different scenarios.
Once these issues are addressed, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you have any questions or need further assistance. 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
|
||
def visit_cafe(self, visitor: dict) -> str: | ||
if "vaccine" not in visitor: | ||
raise NotVaccinatedError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider providing a descriptive message when raising the NotVaccinatedError
to comply with the checklist requirement for descriptive error messages. Example: raise NotVaccinatedError('Visitor is not vaccinated.')
.
|
||
expiration_date = visitor["vaccine"]["expiration_date"] | ||
if expiration_date < datetime.date.today(): | ||
raise OutdatedVaccineError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider providing a descriptive message when raising the OutdatedVaccineError
to comply with the checklist requirement for descriptive error messages. Example: raise OutdatedVaccineError('Visitor's vaccine is outdated.')
.
raise OutdatedVaccineError() | ||
|
||
if not visitor.get("wearing_a_mask", False): | ||
raise NotWearingMaskError() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider providing a descriptive message when raising the NotWearingMaskError
to comply with the checklist requirement for descriptive error messages. Example: raise NotWearingMaskError('Visitor is not wearing a mask.')
.
No description provided.